#!/usr/bin/python

import wx
import wx.stc as stc

FILLER='\nclass MainPanel(wx.Panel):\n\n\tdef __init__(me,parent):\n\t\twx.Panel.__init__(me,parent)\n\t\t\n\t\tme.text=wx.stc.StyledTextCtrl(me)\n\t\t\n\t\tsz=wx.BoxSizer(wx.VERTICAL)\n\t\t\n\t\tme.SetSizer(sz)\n\t\t\n\t\tsz.Add(me.text,1,wx.EXPAND)\n\t\tme.SetAutoLayout(True)\n\t\t\n\t\tme.text.AddText(FILLER)\n\n\t\t\nclass MainFrame(wx.Frame):\n\n\tdef __init__(me):\n\t\t\t\n\t\twx.Frame.__init__(me,parent=None)\n\t\tMainPanel(parent=me)\n\t\t\n\napp = wx.PySimpleApp()\nframe = MainFrame()\nframe.Show()\nframe.Centre()\napp.MainLoop()\n'

import math

class STC:
	STYLE_LINENUMBER=33
	SC_MARGIN_NUMBER=1

	

class MainPanel(wx.Panel):

	def __init__(me,parent):
		wx.Panel.__init__(me,parent)
		
		me.text=stc.StyledTextCtrl(me)
		
		sz=wx.BoxSizer(wx.VERTICAL)
		
		me.SetSizer(sz)
		
		sz.Add(me.text,1,wx.EXPAND)
		me.SetAutoLayout(True)
		
		me.Bind(wx.stc.EVT_STC_MODIFIED, me.OnTextModified)
		
		me.text.AddText(FILLER)
		
		tx=me.text
		tx.SetMarginType(2, stc.STC_MARGIN_SYMBOL)
		#tx.MarkerDefine(2, stc.STC_MARK_SHORTARROW, "blue", "blue")
		tx.MarkerDefine(2, stc.STC_MARK_FULLRECT, "blue", "blue")
		
		tx.MarkerAdd(5,2)
		

	def OnTextModified(me,e):
		pass
		
class MainFrame(wx.Frame):

	def __init__(me):
			
		wx.Frame.__init__(me,parent=None)
		me.panel=MainPanel(parent=me)
		
		mb=wx.MenuBar()
		me.SetMenuBar(mb)
		m=wx.Menu()
		mb.Append(m,"&Menu")
		id=wx.NewId()
		m.Append(id,'Do Something')
		me.Bind(wx.EVT_MENU,me.OnMenuDoSomething,id=id)
		
		me.toggle=True
		
	def OnMenuDoSomething(me,e):
		me.toggle=not me.toggle
		
		

app = wx.PySimpleApp()
frame = MainFrame()
frame.Show()
frame.Centre()
app.MainLoop()